﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace UCL.Forms.Components
{
    interface ISearchAdvanceForm
    {
        /// <summary>
        /// 获取或设置搜索方法
        /// </summary>
        Action<string> SearchHandler { get; set; }

        /// <summary>
        /// 获取或设置预览方法
        /// </summary>
        Action<string> PreviewHandler { get; set; }

        /// <summary>
        /// 获取或设置统计数据文本
        /// </summary>
        string SummaryText { set; }

        /// <summary>
        /// 是否启用调试模式
        /// </summary>
        bool IsDebug { get; set; }

        /// <summary>
        /// 获取或设置搜索字段
        /// <para>ID | Name | Type | Default | DataSource</para>
        /// <para>Type支持：text,date,bool,group,其中,group格式:value=name&value=name</para>
        /// <example>
        /// DataTable dt = new DataTable();
        /// dt.Rows.Add("Text1", "文本1", "text", "默认值1");
        /// dt.Rows.Add("Date2", "日期2", "date", "2013-1-21");
        /// dt.Rows.Add("Bool5", "布尔3", "bool", "false");
        /// dt.Rows.Add("Group6", "下拉4", "group", "0","0=未确认&1=待发货&14=未发货,退回&(7,10,16,17,19)=确认不通过,已退回");
        /// </example>        
        /// </summary>
        DataTable Fields { get; set; }

        /// <summary>
        /// 是否复合组合查询模式
        /// </summary>
        bool IsCompositeGroup { get; set; }
        
        /// <summary>
        /// 获取搜索字符串
        /// </summary>
        /// <returns></returns>
        /// <remarks>2014-4-1 by sutroon</remarks>
        string GetSearchSql();

        /// <summary>
        /// 窗体显示方法
        /// </summary>
        void Show();
    }
}
